<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<html>

<head>
    
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="description" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="robots" content="all,follow">

    <title>Shop Manager</title>
    <link rel="shortcut icon" href="img/favicon.ico" th:href="@{/model1/img/favicon.ico}">

    <!-- global stylesheets -->
    <link href="https://fonts.googleapis.com/css?family=Roboto+Condensed" rel="stylesheet">
    <link rel="stylesheet" href="css/bootstrap.min.css" th:href="@{/model1/css/bootstrap.min.css}">
    <link rel="stylesheet" href="font-awesome-4.7.0/css/font-awesome.min.css" th:href="@{/model1/font-awesome-4.7.0/css/font-awesome.min.css}">
    <link rel="stylesheet" href="css/font-icon-style.css" th:href="@{/model1/css/font-icon-style.css}">
    <link rel="stylesheet" href="css/style.default.css" th:href="@{/model1/css/style.default.css}" id="theme-stylesheet">

    <!-- Core stylesheets -->
    <link rel="stylesheet" href="css/apps/email.css" th:href="@{/model1/css/apps/email.css}">
</head>

<body> 

<!--====================================================
                         MAIN NAVBAR
======================================================-->
    <header th:replace="model1/common/bar::topbar"></header>

<!--====================================================
                        PAGE CONTENT
======================================================-->
    <div class="page-content d-flex align-items-stretch">

        <!--***** SIDE NAVBAR *****-->
        <nav th:replace="model1/common/bar::sidebar(activeUri='product_mng')"></nav>

        <div class="content-inner chart-cont">

            <!--***** CONTENT *****-->     
            <div class="row">
                <!--添加      查询-->
                <div class="col-md-12">
                    <div class="row">
                    <div class="col-md-6">
                        <a href="" th:href="@{/admin/product/add.do}" class="btn btn-success"> 添加新商品 </a>
                    </div>
                    <div class="col-md-6 ">
                        <!--<select id="searchType" class="custom-select mb-2 mr-sm-2 mb-sm-0" >-->
                            <!--<option selected  readonly  th:if="${type!=null}" th:value="${type}" th:text="${typeName}"  ></option>-->
                            <!--<option value="0">商品编号</option>-->
                            <!--<option value="1">商品名称</option>-->
                            <!--<option value="2">商品分类</option>-->
                        <!--</select>-->
                        <input style="width:300px;height:30px;" placeholder="商品名关键词" id="searchKey" name="searchKey" th:value="${key!=null}?${key}:''">
                        <a  th:onclick="'javascript:searchProduct();'" class="btn btn-warning">搜索</a>
                    </div>
                    </div>
                </div>

                <!--翻页-->
                <div class="col-md-12">
                    <ul class="pagination" style="text-align: center; margin-top: 10px;">
                        <li>
                            <a th:href="'javascript:void(0);'"  th:onclick="'javascript:pageUp();'" >
                              &laquo; 上一页
                            </a>
                        </li>
                        <li>
                            <input style="width: 40px;height: 20px" type="text" id="pagenumStr" name="pagenumStr" th:value="${pagenumStr!=null}?${pagenumStr}:'1'">/[[${totalpage}]]
                        </li>
                        <li>
                            <a th:href="'javascript:void(0);'" th:onclick="'javascript:pageDown('+${totalpage}+');'" >
                                <span aria-hidden="true">下一页 &raquo;</span>
                            </a>
                        </li>
                        <li>
                            <button th:onclick="'javascript:toPageNum('+${totalpage}+');'" class="btn btn-send">跳转</button>
                        </li>
                        <li>
                            共[[${count}]]条记录
                        </li>
                    </ul>
                </div>
                <div class="col-md-12">
                    <table class="table table-hover">
                        <thead>
                        <tr class="bg-info text-white">
                            <th scope="row">#</th>
                            <!--<th>编号</th>-->
                            <th>图片</th>
                            <th>名称</th>
                            <th>价格</th>
                            <th>库存</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr th:each="product,pindex:${productList}">
                            <td th:text="${pindex.index+1}"></td>
                            <!--<td th:text="${product.sock_id}"></td>-->
                            <td >
                                <img width="100" height="100" th:src="@{/}+${product.image_url_1}">
                            </td>
                            <td th:text="${product.name}"></td>
                            <td th:text="${product.price}"></td>
                            <td th:text="${product.count}"></td>
                            <td >
                                <a href="" th:href="@{/admin/product/update.do}+'?id='+${product.sock_id}" class="btn btn-primary">详细信息</a>
                                <!--<a class="btn btn-danger" th:href="@{/admin/product/delete.do}+'?id='+${product.sock_id}" >删除</a>-->
                                <!--<a  href="javascript:void(0);" th:onclick="'javascript:deleteCategory('+${product.sock_id}+');'" id="delete" class="btn btn-sm btn-danger">删除</a>-->

                            </td>
                        </tr>
                        </tbody>
                    </table>
                </div>
            </div>
            </div> 

        </div>
    </div>

    <!--Global Javascript -->
    <script src="js/jquery.min.js" th:src="@{/model1/js/jquery.min.js}"></script>
    <script src="js/popper/popper.min.js" th:src="@{/model1/js/popper/popper.min.js}"></script>
    <script src="js/tether.min.js" th:src="@{/model1/js/tether.min.js}"></script>
    <script src="js/bootstrap.min.js" th:src="@{/model1/js/bootstrap.min.js}"></script>
    <script src="js/jquery.cookie.js" th:src="@{/model1/js/jquery.cookie.js}"></script>
    <script src="js/jquery.validate.min.js" th:src="@{/model1/js/jquery.validate.min.js}"></script>
    <script src="js/chart.min.js" th:src="@{/model1/js/chart.min.js}"></script>
    <script src="js/front.js" th:src="@{/model1/js/front.js}"></script>

    <!--Core Javascript -->
    <!--<script src="js/mychart.js" th:src="@{/model1/js/mychart.js}"></script>-->
    <script src="" th:src="@{/model1/js/common.js}"></script>
    <script src="" th:src="@{/model1/js/product/product_mng.js}"></script>
    <!--<script type="text/javascript" src="../../static/js/commonVar.js" th:src="@{/js/commonVar.js}"></script>-->

</body>

</html>